#coding=utf-8
from .model import Model,build_model
from .datatype import IntegerType,DatetimeType,CharType,DecimalType
from .indextype import Key,UniqueKey
import traceback


def create_all(module):
    for key, value in vars(module).items():
        if hasattr(value, '__base__') and value.__base__ is Model:
            #if callable(value.status) and not value.status():
            try:
                value.create_table()
            except:
                traceback.print_exc()
            print 'created', key
            #elif not callable(value.status):
                #value.create_table()
            #else:
            #    print 'exists',key